home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 959 b | 62 lines | [TEXT/CWIE] |
- // FontSize.cp
-
- #ifndef FontSize_h
- #include "FontSize.h"
- #endif
-
- FontSize FontSize::Make( uint16 value )
- {
- Assert( value >= 0 );
-
- if ( value == 0 )
- return Default();
-
- return value;
- }
-
- FontSize FontSize::Default()
- {
- static int16 size = GetDefFontSize();
- return size;
- }
-
- void FontSize::operator+=( int16 d )
- {
- int32 result = int32( size ) + int32( d );
-
- Assert( result > 0 );
- Assert( result <= maxint16 );
-
- size = result;
- }
-
- void FontSize::operator-=( int16 d )
- {
- int32 result = int32( size ) - int32( d );
-
- Assert( result > 0 );
- Assert( result <= maxint16 );
-
- size = result;
- }
-
- FontSize FontSize::operator+( int16 d ) const
- {
- int32 result = int32( size ) + int32( d );
-
- Assert( result > 0 );
- Assert( result <= maxint16 );
-
- return result;
- }
-
- FontSize FontSize::operator-( int16 d ) const
- {
- int32 result = int32( size ) - int32( d );
-
- Assert( result > 0 );
- Assert( result <= maxint16 );
-
- return result;
- }
-